<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<!--head部分-->
<head>
  <meta charset="UTF-8">
  <title>商家后台</title>
  <th:block th:include="common.html :: source"></th:block>
  <link rel="stylesheet" href="/layui/css/layui.css"/>
</head>
<style>

</style>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <!--头-->
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header" style="background: linear-gradient(to left,  #FF8C00, #800080); height: 80px">
      <a href="javascript:;" class="layui-hide-xs"><a href="/mhome" >
        <div class="layui-logo" style="color: #fff;font-family: Gabriola; font-size: 35px">Mall system</div></a>
      </a>
      <ul class="layui-nav layui-layout-right" th:if="${session.loginInfo} != null">
        <li class="layui-nav-item">
          <a href="javascript:;">
            <img src="/images/logo.png" class="layui-nav-img"/>
            <span style="color: #fff" th:text="${session.loginInfo.getUsername()}"></span>
          </a>
          <dl class="layui-nav-child">
            <dd id="updUsePwdDd" class="layui-this"><a href="javascript:;" onclick="updateUsePwd();">修改密码</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a style="color: #fff"  href="/loginOut">退出</a></li>
      </ul>
    </div>

    <div class="layui-side layui-bg-cyan" style="margin-top: 20px;">
      <div class="layui-side-scroll" >
        <ul class="layui-nav layui-nav-tree layui-bg-cyan" lay-filter="test">
          <li class="layui-nav-item">
            <a href="/merchant/toShoeInfo" target="right">商品信息</a>
          </li>
          <li class="layui-nav-item">
            <a href="/merchant/toOrderMaster" target="right">订单信息</a>
          </li>
          <li class="layui-nav-item">
            <a href="/merchant/toUpdateInfo" target="right">修改信息</a>
          </li>
          <li class="layui-nav-item">
            <a href="javascript:;">规格信息</a>
            <dl class="layui-nav-child">
              <dd><a href="/merchant/toSpecsColor" target="right">颜色</a></dd>
              <dd><a href="/merchant/toSpecsSize" target="right">尺码</a></dd>
              <dd><a href="/merchant/toSpecsInfo" target="right">商品规格</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item">
            <a href="javascript:;">公告</a>
            <dl class="layui-nav-child gonggao">

            </dl>
          </li>

        </ul>
      </div>
    </div>
  </div>
  <script src="/layui/layui.js" charset="UTF-8"></script>
  <script type="text/javascript" src="/js/head.js"></script>
  <!--主体区域-->
  <div class="admin">
    <iframe  src="/merchant/admin" name="right" width="100%" height="100%">
    </iframe>
  </div>

</div>

<script type="text/javascript">
  layui.use(['element', 'layer'],function(){
    var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

    //监听导航点击
    element.on('nav(demo)', function(elem){
      //console.log(elem)
    });
    //查询公告
    $.post({
        url: "/merchant/findTitles",
        success: function (resp) {
            var url="/merchant/toBulletin";
            $.each(resp, function (index, item) {
                $(".gonggao").append('<dd id="'+item+'"><a  href="'+url+'?title=' + item + '" target="right"><div style="padding-left: 35px" >' + item + '</div></a></dd>')
            });
        }
    });
  });
</script>

</body>
</html>